<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: shanpengfei
  Date: 2019/2/28
  Time: 5:58 PM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<c:set var="basePath" value="/gyp"></c:set>

<style>
    .goods-show {
        width: 500px;
        margin: 30px auto 40px auto;
    }
    .goods-show ul li {
        display: inline-block;
    }
    .goods-show ul li a {
        display: block;
        padding: 15px 10px;
        width: 100px;
        text-align: center;
    }
    .goods-show ul li a:hover {
        background: rgb(108, 191, 217);
        color: #000; /* 文字颜色 */
    }
    .goods-show .show-box {
        display: inline-block;
        width: 245px;
    }
    .goods-show .show-item {
        padding: 2px 20px;
        line-height: 30px;
    }
    .goods-show .show-item .show-item-label {
        display: inline-block;
    }
    .goods-show .show-item .show-item-text {
        display: inline-block;
    }

    .goods-show .goods-buy a {
        display: block;
        margin: 0 auto;
        padding: 10px 30px;
        width: 50px;
        height: 20px;
        line-height: 20px;
        border-radius: 10px;
        background: rgb(157, 184, 102);
        text-align: center;
        color: #fff;
        font-size: 18px;
        font-weight: 700;
    }
    .goods-show .goods-pl {
        position: relative;
        display: block;
        width: 500px;
        border-radius: 10px;
    }
    .main-box .goods-show .goods-pl input[type='submit'] {
        position: absolute;
        top: 10px;
        right: 0px;
    }
    .goods-show .goods-pl-list {
        display: block;
        width: 500px;
        border-radius: 10px;
    }
    .goods-show .goods-pl-list .list-item {
        position: relative;
        padding: 10px 20px;
    }
    .goods-show .goods-pl-list .list-item  .item-time{
        position: absolute;
        top: 2px;
        right: 20px;
        font-size: 12px;
    }
    .goods-show .goods-pl-list .list-item  .item-content{
        font-size: 14px;
        text-indent: 2em;
    }
</style>

<jsp:include page="../template_header.jsp"></jsp:include>

<div class="goods-show">

    <ul>
        <li><a href="${basePath}/goods/show/${goods.id}">历史沿革</a></li>
        <li><a href="${basePath}/goods/show2/${goods.id}">工艺技法</a></li>
        <li><a href="${basePath}/goods/show3/${goods.id}">工艺分类</a></li>
        <li><a href="${basePath}/goods/show4/${goods.id}">成品展示</a></li>
    </ul>

    <div class="show-box">
        <div class="show-item">
            <div class="show-item-label">工艺品ID:</div>
            <div class="show-item-text">${goods.id}</div>
        </div>
        <div class="show-item">
            <div class="show-item-label">工艺品类型:</div>
            <div class="show-item-text">${list.type==1?'雕刻':list.type==2?'瓷器':list.type==3?'编制品':'其他'}</div>
        </div>
        <div class="show-item">
            <div class="show-item-label">工艺品名称:</div>
            <div class="show-item-text">${goods.name}</div>
        </div>
        <div class="show-item">
            <div class="show-item-label">工艺品代码:</div>
            <div class="show-item-text">${goods.code}</div>
        </div>
    </div>
    <div class="show-box">
        <div class="show-item">
            <div class="show-item-label">工艺品价格:</div>
            <div class="show-item-text">${goods.price/100}元</div>
        </div>
        <div class="show-item">
            <div class="show-item-label">工艺品数量:</div>
            <div class="show-item-text">${goods.count}件</div>
        </div>
        <div class="show-item">
            <div class="show-item-label">工艺品所在省:</div>
            <div class="show-item-text">${goods.province}</div>
        </div>
        <div class="show-item">
            <div class="show-item-label">工艺品所属民族:</div>
            <div class="show-item-text">${goods.nation}</div>
        </div>
    </div>

    <div class="goods-pl">
        <form action="${basePath}/pl/goods/add" method="post">
            <input type="hidden" name="goodsId" value="${goods.id}" id="">
            <textarea name="content" placeholder="评论内容" cols="80" rows="7"></textarea><br>
            <input type="submit" value="评论">
        </form>
    </div>
    <div class="goods-pl-list">
        <c:forEach items="${pl}" var="list">
            <ul class="list-item">
                <li class="item-text">${list.user.username}:</li>
                <li class="item-content">${list.content}</li>
                <li class="item-time"><fmt:formatDate value="${list.createAt }" pattern="yyyy-MM-dd HH:mm:ss"/></li>
            </ul>
        </c:forEach>
    </div>
</div>

<jsp:include page="../template_footer.jsp"></jsp:include>
